/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GlobalTablePanel.java
 *
 * Created on 3 mars 2011, 13:54:50
 */

package gui;

import javax.swing.JTable;
import model.IPTableRule;
import model.IPSecRule;
import model.IPSecPolicy;
import java.util.ArrayList;

/**
 *
 * @author tduquenn
 */
public class GlobalTablePanel extends javax.swing.JPanel {

    private ArrayList<IPSecPolicy> IPSecPolicies;
    private ArrayList<IPSecRule> IPSecRules;
    private ArrayList<IPTableRule> IPTableRules;

    public GlobalTablePanel(ArrayList<IPSecPolicy> IPSecPolicies, ArrayList<IPSecRule> IPSecRules, ArrayList<IPTableRule> IPTableRules) {
        this.IPSecPolicies = IPSecPolicies;
        this.IPSecRules = IPSecRules;
        this.IPTableRules = IPTableRules;
        initComponents();
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();

        setMaximumSize(new java.awt.Dimension(903, 551));
        setMinimumSize(new java.awt.Dimension(903, 551));
        setPreferredSize(new java.awt.Dimension(903, 551));
        setLayout(new java.awt.GridLayout(3, 1, 10, 10));

        jPanel1.setLayout(new java.awt.GridLayout());

        jScrollPane1.setMinimumSize(new java.awt.Dimension(903, 551));
        jScrollPane1.setPreferredSize(new java.awt.Dimension(903, 551));

        jTable1.setAutoCreateRowSorter(true);
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Name", "Chain", "Source", "Destination", "Protocol", "Source port", "Destination port", "Jump"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.setCellSelectionEnabled(false);
        jTable1.setMaximumSize(new java.awt.Dimension(903, 551));
        jTable1.setMinimumSize(new java.awt.Dimension(903, 551));
        jTable1.setPreferredSize(new java.awt.Dimension(903, 551));
        jTable1.setRowSelectionAllowed(true);
        jTable1.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(jTable1);

        jPanel1.add(jScrollPane1);

        add(jPanel1);

        jPanel2.setLayout(new java.awt.GridLayout());

        jScrollPane2.setMaximumSize(new java.awt.Dimension(903, 551));
        jScrollPane2.setMinimumSize(new java.awt.Dimension(903, 551));
        jScrollPane2.setPreferredSize(new java.awt.Dimension(903, 551));

        jTable2.setAutoCreateRowSorter(true);
        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Name", "Source", "Destination", "Protocol", "Direction", "Action", "Tunnel in", "Tunnel out", "Type", "Transport type", "Level"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable2.setCellSelectionEnabled(false);
        jTable2.setColumnSelectionAllowed(false);
        jTable2.setMaximumSize(new java.awt.Dimension(903, 551));
        jTable2.setMinimumSize(new java.awt.Dimension(903, 551));
        jTable2.setPreferredSize(new java.awt.Dimension(903, 551));
        jTable2.setRowSelectionAllowed(true);
        jTable2.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(jTable2);

        jPanel2.add(jScrollPane2);

        add(jPanel2);

        jPanel3.setLayout(new java.awt.GridLayout());

        jScrollPane3.setMaximumSize(new java.awt.Dimension(903, 551));
        jScrollPane3.setMinimumSize(new java.awt.Dimension(903, 551));
        jScrollPane3.setPreferredSize(new java.awt.Dimension(903, 551));

        jTable3.setAutoCreateRowSorter(true);
        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Name", "Source", "Destination", "Type", "Transport type", "spi", "Algorythm", "Key"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable3.setCellSelectionEnabled(false);
        jTable3.setMaximumSize(new java.awt.Dimension(903, 551));
        jTable3.setMinimumSize(new java.awt.Dimension(903, 551));
        jTable3.setPreferredSize(new java.awt.Dimension(903, 551));
        jTable3.setRowSelectionAllowed(true);
        jTable3.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(jTable3);

        jPanel3.add(jScrollPane3);

        add(jPanel3);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    protected javax.swing.JTable jTable1;
    protected javax.swing.JTable jTable2;
    protected javax.swing.JTable jTable3;
    // End of variables declaration//GEN-END:variables

    public JTable getjTable1() {
        return jTable1;
    }

    public JTable getjTable2() {
        return jTable2;
    }

    public JTable getjTable3() {
        return jTable3;
    }

}
